package com.hds.modules.app.controller;

import com.hds.common.utils.PageUtils;
import com.hds.common.utils.R;
import com.hds.modules.app.annotation.Login;
import com.hds.modules.app.annotation.LoginUser;
import com.hds.modules.app.entity.UserEntity;
import com.hds.modules.sys.controller.AbstractController;
import com.hds.modules.sys.service.base.SysMemberShipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author guonan
 * @Email guonan@yewcn.com
 * @Description 会员
 * @Date 2018/6/12 14:13
 */
@RestController
@RequestMapping("/app/membership/")
public class AppMemberShipController extends AbstractController{


    @Autowired
    private SysMemberShipService sysMemberShipService;

    @Login
    @GetMapping("/list")
    public R list(@LoginUser UserEntity user, @RequestParam Map<String, Object> params){
        logger.info("当前用户id:{}", user.getUserId());
        params.put("uid", String.valueOf(user.getUserId()));
        PageUtils page = sysMemberShipService.queryPage(params);

        return R.ok().put("page", page);
    }


}
